package com.example.demoboot.meiju;

public enum StatusEnumList {
    //枚举
    //什么是枚举？枚举是一种类型   类的类型  enum是枚举类的关键字
    //有什么用？ 枚举类是代码版的配置文件！
    RENMINBI(1,"启用"),MEIYUAN(0,"禁用");
    private Integer value;
    private String currency2;
    StatusEnumList(Integer value, String currency){
        this.currency2 = currency;
        this.value = value;
    }

    public String getCurrency(){
        return currency2;
    }
    public Integer getValue(){
        return value;
    }

    public String getCurrencyName(Integer value){
        for (StatusEnumList cr : StatusEnumList.values()){
            if (cr.getValue()==value){
                return cr.getCurrency();
            }
        }
        return null;
    }
    public static Integer getCurrencyValue(String name){
        for (StatusEnumList cr : StatusEnumList.values()){
            if (cr.getCurrency().equals(name)){
                return cr.getValue();
            }
        }
        return null;
    }


}
